{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "91bfb007",
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "import os\n",
    "import matplotlib"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "bcb8f289",
   "metadata": {},
   "outputs": [],
   "source": [
    "weight_path = '/usr/xtmp/zg78/proto_proj/saved_models/eeg_model/07-25-2022_17-11_random=44_class_weighted_m_OFF_identity_CVall_fullset_1658783472/40_2push0.6683_extracted_features/_usr_xtmp_zg78_proto_proj_data_10_train_test_split_50s__test_/last_layer_weight_T.npy'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "f293c5b1",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "activations.npy\r\n",
      "annoy_index.ann\r\n",
      "base_multi_class_prototype_3topoverall_before_merge.csv\r\n",
      "base_multi_class_prototype_3topoverall.csv\r\n",
      "extracted_features.npy\r\n",
      "labels.npy\r\n",
      "last_layer_weight_T.npy\r\n",
      "logits_marginlesses.npy\r\n",
      "nbrs.npy\r\n",
      "predictions.npy\r\n",
      "proto_logits_marginlesses.npy\r\n",
      "sample_ids.npy\r\n",
      "tmp_annoy_index.ann\r\n",
      "top_class_info.csv\r\n",
      "X_transformed.npy\r\n"
     ]
    }
   ],
   "source": [
    "!ls /usr/xtmp/zg78/proto_proj/saved_models/eeg_model/07-25-2022_17-11_random=44_class_weighted_m_OFF_identity_CVall_fullset_1658783472/40_2push0.6683_extracted_features/_usr_xtmp_zg78_proto_proj_data_10_train_test_split_50s__test_/"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "c68b0abf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(45, 6)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "weight = np.load(weight_path)\n",
    "weight.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "1aa7089c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAR8AAAZtCAYAAAD7GlAJAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAa00lEQVR4nO3a/c/vdUHH8evD+V6HcwNHEM3IxNRudAzpdo6UQUNEbXkzc2mrwZZzWlPWlsS8o3L+kOHmT610U4Y1bKnLH0ojjOjYjS7JjUwo28xIwDU5IHA8d9enf+C77/b5/NDTT9/H48f3+5cX167zvN4bn2Ecxx2A/2tn1QOA7SQ+QEJ8gIT4AAnxARLiAyRWmy5f+OF/XOT/h/+5nzhRT5jsvP0n6wmzHFqdqSfMcv8TB+sJk73wexb5z3HniguvHNade/kACfEBEuIDJMQHSIgPkBAfICE+QEJ8gIT4AAnxARLiAyTEB0iID5AQHyAhPkBCfICE+AAJ8QES4gMkxAdIiA+QEB8gIT5AQnyAhPgACfEBEuIDJMQHSIgPkBAfICE+QEJ8gIT4AAnxARLiAyTEB0iID5AQHyAhPkBCfICE+AAJ8QES4gMkxAdIiA+QGMZxrDcAW8jLB0iID5AQHyAhPkBCfICE+AAJ8QES4gMkVpsuL/3AXYv8AvGXr9qrJ0z29EPH6wmzfPnYkXrCLBef92g9YbLz9u+vJ8zysme8eFh37uUDJMQHSIgPkBAfICE+QEJ8gIT4AAnxARLiAyTEB0iID5AQHyAhPkBCfICE+AAJ8QES4gMkxAdIiA+QEB8gIT5AQnyAhPgACfEBEuIDJMQHSIgPkBAfICE+QEJ8gIT4AAnxARLiAyTEB0iID5AQHyAhPkBCfICE+AAJ8QES4gMkxAdIiA+QEB8gMYzjWG8AtpCXD5AQHyAhPkBCfICE+AAJ8QES4gMkxAdIrDZdXvOn/7zILxBff+k36wmTfeP4gXrCLE89cK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AdIiA+QEB8gIT5AQnyAhPgACfEBEuIDJMQHSIgPkBAfICE+QEJ8gIT4AAnxARLiAyTEB0iID5AQHyAhPkBCfICE+AAJ8QES4gMkxAdIiA+QEB8gIT5AQnyAhPgACfEBEuIDJMQHSIgPkBAfIDGM41hvALaQlw+QEB8gIT5AQnyAhPgACfEBEuIDJMQHSIgPkFhtuvzAv/z1Ij9/fuY5J+sJk93/+G49YZYj+0/VE2Y5Mw71hMl+95P76gmz3Hfji9f+sL18gIT4AAnxARLiAyTEB0iID5AQHyAhPkBCfICE+AAJ8QES4gMkxAdIiA+QEB8gIT5AQnyAhPgACfEBEuIDJMQHSIgPkBAfICE+QEJ8gIT4AAnxARLiAyTEB0iID5AQHyAhPkBCfICE+AAJ8QES4gMkxAdIiA+QEB8gIT5AQnyAhPgACfEBEuIDJIZxHOsNwBby8gES4gMkxAdIiA+QEB8gIT5AQnyAhPgAidWmyz/72l8u8gvEk3tn6gmTHT+zzL8D//bIufWEWQ6tTtcTJrvlL07WE2b597dfPaw7X+ZvPLB44gMkxAdIiA+QEB8gIT5AQnyAhPgACfEBEuIDJMQHSIgPkBAfICE+QEJ8gIT4AAnxARLiAyTEB0iID5AQHyAhPkBCfICE+AAJ8QES4gMkxAdIiA+QEB8gIT5AQnyAhPgACfEBEuIDJMQHSIgPkBAfICE+QEJ8gIT4AAnxARLiAyTEB0iID5AQHyAxjONYbwC2kJcPkBAfICE+QEJ8gIT4AAnxARL/C2wDu6ojV/a7AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 2160x2160 with 30 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, axs = plt.subplots(30, 1, figsize=(30, 30))\n",
    "for i in range(30):\n",
    "    axs[i].matshow(weight[i].reshape(1, 6), cmap=matplotlib.cm.GnBu, interpolation='none', vmin=np.min(weight), vmax=np.max(weight))\n",
    "    class_idxs = np.argsort(weight[i])[-1]\n",
    "#     axs[i].scatter(class_idxs, 0, marker='$\\checkmark$', s=200, c='k')\n",
    "    axs[i].axis('off')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "debee11d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAASEAAAM9CAYAAADTlsXSAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAANo0lEQVR4nO3a3+vddQHH8X3sbKOFllhGQXhRgWAJFRFYRFJSilEQw6SSgsiLWPaLIiyprYYWkmKGRT+cGFFIYQRhYpJUXiSTLiK0oiIwWlut6Zpu009/wTlwPjfPfXYej9v3zeucne+TN+w9jOO4BaByRj0A2GwiBKRECEiJEJASISC1WHV4yQ/2z/K/zn5120/rCZN86saL6wlru/DsJ+oJk/z58WfXEyZ58ul53huue9Ubh2Vn8/xEwGlDhICUCAEpEQJSIgSkRAhIiRCQEiEgJUJASoSAlAgBKRECUiIEpEQISIkQkBIhICVCQEqEgJQIASkRAlIiBKRECEiJEJASISAlQkBKhICUCAEpEQJSIgSkRAhIiRCQEiEgJUJASoSAlAgBKRECUiIEpEQISIkQkBIhICVCQEqEgJQIASkRAlIiBKSGcRzrDcAGcxMCUiIEpEQISIkQkBIhICVCQEqEgJQIAanFqsNX3Hj/LF8yXnP5iXrCJB//2tF6wtqueNdL6gmTvPrcw/WESR49fGY9YZKbLnrdsOzMTQhIiRCQEiEgJUJASoSAlAgBKRECUiIEpEQISIkQkBIhICVCQEqEgJQIASkRAlIiBKRECEiJEJASISAlQkBKhICUCAEpEQJSIgSkRAhIiRCQEiEgJUJASoSAlAgBKRECUiIEpEQISIkQkBIhICVCQEqEgJQIASkRAlIiBKRECEiJEJASISAlQkBKhIDUMI5jvQHYYG5CQEqEgJQIASkRAlIiBKRECEiJEJASISC1WHV4/g33zfIl4wcvm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JUJASoSAlAgBKRECUiIEpEQISIkQkBIhICVCQEqEgJQIASkRAlIiBKRECEiJEJASISAlQkBKhICUCAEpEQJSIgSkRAhIiRCQEiEgJUJASoSAlAgBKRECUiIEpEQISIkQkBIhICVCQEqEgJQIASkRAlIiBKRECEiJEJASISAlQkBKhICUCAEpEQJSwziO9QZgg7kJASkRAlIiBKRECEiJEJASISAlQkBKhIDUYtXhtx+5Z5YvGYehXjDNwSe31xPW9uIdx+oJk+z6+vF6wiRbF/O8Nxz48tuX/lXO8xMBpw0RAlIiBKRECEiJEJASISAlQkBKhICUCAEpEQJSIgSkRAhIiRCQEiEgJUJASoSAlAgBKRECUiIEpEQISIkQkBIhICVCQEqEgJQIASkRAlIiBKRECEiJEJASISAlQkBKhICUCAEpEQJSIgSkRAhIiRCQEiEgJUJASoSAlAgBKRECUiIEpEQISIkQkBrGcaw3ABvMTQhIiRCQEiEgJUJASoSAlAgBqf8DvDjlWXkHS0wAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 2160x1080 with 15 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, axs = plt.subplots(15, 1, figsize=(30, 15))\n",
    "for i in range(30, 45):\n",
    "    axs[i-30].matshow(weight[i].reshape(1, 6), cmap=matplotlib.cm.GnBu, interpolation='none', vmin=np.min(weight), vmax=np.max(weight))\n",
    "    class_idxs = np.argsort(weight[i])[-2:]\n",
    "#     axs[i-30].scatter(class_idxs[0], 0, marker='$\\checkmark$', s=200, c='k')\n",
    "#     axs[i-30].scatter(class_idxs[1], 0, marker='$\\checkmark$', s=200, c='k')\n",
    "    \n",
    "    axs[i-30].axis('off')\n",
    "    \n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "44121c16",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x7f4d5c696400>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAJkAAAOfCAYAAADb7WE6AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAcAElEQVR4nO3df5Dc9X3f8df79k4n6SSQACHLSIHEpR4oqQW9UiYaOzH4BwEn4LaZsRt7NA0zwhOT2uNMMyTT1vZ/nmlsPJNJnMiGiaaAOySYgimxrcoQSuwChy1+VcSKMQkgWeKXhHSnX3v37h+3dDTmfqxu36/ldvN8zNzc3u7e+z7onnx1t/rsdyMzBTgNvNULQP8jMtgRGeyIDHZEBjsig92iiiwiroyIv42Iv4uIGwvm3RIR+yPiqYJZGyLi/ojYFRFPR8SnOpy3NCIeiYjHW/M+X7DGRkT8MCLu7XRWa95zEfFkROyMiLEFD8rMRfEmqSHpx5J+QdISSY9LurDDme+RdImkpwrWt07SJa3LKyX9qJP1SQpJK1qXhyQ9LOmyDtf4GUm3S7q36HvynKSzOp2zmI5kl0r6u8x8NjOPS/rvkq7pZGBmPijp1YrFZebezPxB6/IhSbskndPBvMzMw60Ph1pvC35kPCLWS7pa0tcWOsNlMUV2jqTnT/r4BXXwTXSKiPMkXazpo08ncxoRsVPSfknbM7OTeV+W9HuSpjpZ089ISd+JiMciYstChyymyGKG6xbdv3lFxApJd0r6dGa+3smszJzMzI2S1ku6NCIuWuCaPiRpf2Y+1sl6ZrApMy+R9KuSPhkR71nIkMUU2QuSNpz08XpJe96itcwoIoY0HdhtmfmNqrmZeUDSA5KuXOCITZJ+PSKe0/SPGZdHxK0F69rTer9f0l2a/pHmlC2myB6VdH5E/HxELJH0EUn3vMVr+v8iIiTdLGlXZn6pYN6aiFjVurxM0vskPbOQWZn5+5m5PjPP0/Sf23cz82Mdrm8kIla+cVnSByQt6Lf0RRNZZjYl3SDp25r+ofqOzH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FuUP5OhvyzWIxn6CJHBjshgR2SwIzLY/T/+v/3INydgCwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 288x1152 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.matshow(weight)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "a712c146",
   "metadata": {},
   "outputs": [],
   "source": [
    "classes = ['other', 'seizure', 'lpd', 'gpd', 'lrda', 'grda']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "b40e6ec7",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Prototype 1 : other\n",
      "Prototype 2 : other\n",
      "Prototype 3 : other\n",
      "Prototype 4 : other\n",
      "Prototype 5 : other\n",
      "Prototype 6 : seizure\n",
      "Prototype 7 : seizure\n",
      "Prototype 8 : seizure\n",
      "Prototype 9 : lpd\n",
      "Prototype 10 : seizure\n",
      "Prototype 11 : lpd\n",
      "Prototype 12 : lpd\n",
      "Prototype 13 : lpd\n",
      "Prototype 14 : lpd\n",
      "Prototype 15 : lpd\n",
      "Prototype 16 : gpd\n",
      "Prototype 17 : gpd\n",
      "Prototype 18 : gpd\n",
      "Prototype 19 : gpd\n",
      "Prototype 20 : gpd\n",
      "Prototype 21 : lrda\n",
      "Prototype 22 : lrda\n",
      "Prototype 23 : lrda\n",
      "Prototype 24 : lrda\n",
      "Prototype 25 : lrda\n",
      "Prototype 26 : grda\n",
      "Prototype 27 : grda\n",
      "Prototype 28 : grda\n",
      "Prototype 29 : grda\n",
      "Prototype 30 : grda\n",
      "Prototype 31 : ['other', 'seizure']\n",
      "Prototype 32 : ['other', 'lpd']\n",
      "Prototype 33 : ['other', 'gpd']\n",
      "Prototype 34 : ['lrda', 'other']\n",
      "Prototype 35 : ['other', 'grda']\n",
      "Prototype 36 : ['seizure', 'lpd']\n",
      "Prototype 37 : ['gpd', 'seizure']\n",
      "Prototype 38 : ['lrda', 'seizure']\n",
      "Prototype 39 : ['grda', 'seizure']\n",
      "Prototype 40 : ['lpd', 'gpd']\n",
      "Prototype 41 : ['lrda', 'lpd']\n",
      "Prototype 42 : ['lpd', 'grda']\n",
      "Prototype 43 : ['gpd', 'lrda']\n",
      "Prototype 44 : ['grda', 'gpd']\n",
      "Prototype 45 : ['grda', 'lrda']\n"
     ]
    }
   ],
   "source": [
    "for i in range(45):\n",
    "    w = weight[i]\n",
    "    if i <= 29:\n",
    "        class_idxs = np.argsort(w)[-1]\n",
    "        print('Prototype', i+1, ':', classes[class_idxs])\n",
    "    else:\n",
    "        class_idxs = np.argsort(w)[-2:]\n",
    "        print('Prototype',i+1, ':', [classes[j] for j in class_idxs])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "7f32c4ff",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'\\nP12 - LPD\\nP31 - experts say Other, model uses as a Other/LPD\\nP19 - model GPD/LPD by model, experts say mostly GPD\\nP39 - model GPD/LPD by model, experts say mostly GPD\\nP20: Model says LRDA, votes split between LPD and LRDA\\nP42: experts say GPD, model says LRDA/Other?\\nP40: experts say LPD/LRDA\\nP26 other according the experts, GRDA by model\\nP43: GPD/GRDA crossover\\nP44: LRDA/GRDA\\nP34: Other/GRDA according to experts\\nP33: Other/LRDA by votes\\nP41: votes split mostly Other\\nP41: 4 for LPD 4 for GRDA\\nP32: LPD, GPD, Other\\nP0: other\\nP30: Other, with some seizure\\n'"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'''\n",
    "P31 - experts say Other, model uses as a Other/LPD\n",
    "P19 - model GPD/LPD by model, experts say mostly GPD\n",
    "P39 - model GPD/LPD by model, experts say mostly GPD\n",
    "P20: Model says LRDA, votes split between LPD and LRDA\n",
    "P42: experts say GPD, model says LRDA/Other?\n",
    "P40: experts say LPD/LRDA\n",
    "P26 other according the experts, GRDA by model\n",
    "P43: GPD/GRDA crossover\n",
    "P44: LRDA/GRDA\n",
    "P34: Other/GRDA according to experts\n",
    "P33: Other/LRDA by votes\n",
    "P41: votes split mostly Other\n",
    "P41: 4 for LPD 4 for GRDA\n",
    "P32: LPD, GPD, Other\n",
    "P0: other\n",
    "P30: Other, with some seizure\n",
    "'''"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4cdbb2bc",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
